package org.csu.demo.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

@Data
@TableName("account")
public class Account {
    @TableId("userid")
    private String username;
    /*@TableField(FieldStrategy.NOT_NULL)*/
    /*@TableField(FieldStrategy.IGNORED)*/
    private String email;
    private String firstname;
    private String lastname;
    private String status;
    @TableField("addr1")
    private String address1;
    @TableField("addr2")
    private String address2;
    private String city;
    private String state;
    private String zip;
    private String country;
    private String phone;

    @JsonIgnore
    public boolean isAllNull(){
        if(this.email !=null ||this.firstname !=null ||this.lastname !=null){
            return false;
        }else {
            return true;
        }
    }
}
